/*
 * Teknei 2014 - All rights reserved
 */
package com.teknei.acabus.core.persistence.dao;

import java.util.List;

import javax.ejb.Local;

import com.teknei.acabus.PersistenceException;
import com.teknei.acabus.core.entities.NavigationChild;
import com.teknei.acabus.core.entities.NavigationParent;

/**
 * DAO Interface for accessing Navigation elements {@link NavigationParent} {@link NavigationChild}
 * @author Jorge Amaro
 * @version 1.0
 * @since 1.0
 *
 */
@Local
public interface NavigationDAO {

	/**
	 * Finds all the NavigationParent elements
	 * @return the list of items
	 * @throws PersistenceException
	 */
	List<NavigationParent> findAllNavParent() throws PersistenceException;

	/**
	 * Finds all the NavigationChild elements
	 * @return the list of items
	 * @throws PersistenceException
	 */
	List<NavigationChild> findAllNavChild() throws PersistenceException;

	/**
	 * Finds the NavigationChildren related element based on the id of the parent
	 * @param idParent the id of the record
	 * @return the list of items
	 * @throws PersistenceException
	 */
	List<NavigationChild> findNavChildRelated(int idParent) throws PersistenceException;

	/**
	 * Saves the instance of NavigationParent
	 * @param t instance
	 * @return the NavigationParent created entity
	 * @throws PersistenceException
	 */
	NavigationParent createNavigationParent(NavigationParent t)
			throws PersistenceException;

	/**
	 * Saves the instance of NavigationChild
	 * @param t instance
	 * @return the NavigationChild created entity
	 * @throws PersistenceException
	 */
	NavigationChild createNavigationChild(NavigationChild t)
			throws PersistenceException;

	/**
	 * Deletes the NavigationChild element
	 * @param t entity
	 * @throws PersistenceException
	 */
	void deleteNavigationChild(NavigationChild t) throws PersistenceException;

	/**
	 * Delete NavigationParent element
	 * @param t entity
	 * @throws PersistenceException
	 */
	void deleteNavigationParent(NavigationParent t) throws PersistenceException;

	/**
	 * Updates the NavigationParent element
	 * @param t instance
	 * @return the NavigationParent updated entity
	 * @throws PersistenceException
	 */
	NavigationParent updateNavigationParent(NavigationParent t)
			throws PersistenceException;

	/**
	 * Updates the NavigationChild element
	 * @param t instance
	 * @return the NavigationChild updated instance
	 * @throws PersistenceException
	 */
	NavigationChild updateNavigationChild(NavigationChild t)
			throws PersistenceException;

	/**
	 * Updates the NavigationParent with its collection of Roles
	 * @param t entity
	 * @return the NavigationParent updated instance
	 * @throws PersistenceException
	 */
	NavigationParent updateNavigationParentWithRoles(NavigationParent t)
			throws PersistenceException;

	/**
	 * Updates the NavigationChild with its collection of Roles
	 * @param t entity
	 * @return the NavigationChild updated instance
	 * @throws PersistenceException
	 */
	NavigationChild updateNavigationChildWithRoles(NavigationChild t)
			throws PersistenceException;

}
